How do we find the probability of winning a game so complex that its states exceed the number of atoms in the universe? When analytical mathematics becomes intractable, we turn to the laboratory of the computer. Simulation: This method of empirically determining probabilities by means of experimentation is known as simulation, serving as a bridge between theoretical probability and real-world application.
The Architecture of an Experiment
At the heart of every simulation lies the replication of stochastic processes. Instead of solving a closed-form equation, we simulate the system's behavior through repeated trials. To translate these physical outcomes into mathematical data, we employ Indicator Variables.
To quantify outcomes, we define random variables that capture the success or failure of an event. For example, in a dice game:
$$X = \begin{cases} 1 & \text{if the sum of the dice is 6} \\ 0 & \text{otherwise} \end{cases}$$
For more complex games like solitaire, we define $X_i$ as the outcome of the $i$th trial:
$$X_i = \begin{cases} 1 & \text{if the } i\text{th game results in a win} \\ 0 & \text{otherwise} \end{cases}$$
Crucially, the expected value $E[X_i] = P\{\text{win at solitaire}\}$.
Theoretical Convergence
Why does this work? The validity of simulation rests on the Strong Law of Large Numbers (SLLN). We define our estimator as the sample average:
$$\sum_{i=1}^n \frac{X_i}{n} = \frac{\text{number of games won}}{\text{number of games played}}$$
This is an unbiased estimator. By the strong law of large numbers, we know that $\sum_{i=1}^n \frac{X_i}{n}$ will, with probability 1, converge to $P\{\text{win at solitaire}\}$ as $n \to \infty$.
Example: The Solitaire Paradox
Imagine calculating the exact probability of winning a complex game of solitaire. Analytical combinatorics would be nearly impossible due to the sheer number of deck states. Instead, we program a computer to play $n = 1,000,000$ games using a fixed strategy. By tracking $X_i$ for each game, the resulting fraction of wins provides a high-precision estimate of the win probability that would be otherwise unobtainable through standard counting methods.